package com.travel.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 评论
 * @TableName review
 */
@TableName(value ="review")
@Data
public class Review implements Serializable {
    /**
     * 评论id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @TableField(value = "userId")
    private Integer userid;

    /**
     * 
     */
    @TableField(value = "attractions_id")
    private Integer attractionsId;

    /**
     * 评分(最高5分)
     */
    @TableField(value = "review_acore")
    private Integer reviewAcore;

    /**
     * 点评内容
     */
    @TableField(value = "review_details")
    private String reviewDetails;

    /**
     * 点评图片
     */
    @TableField(value = "review_images")
    private String reviewImages;

    /**
     * 出游类型(1、商务旅行 2、朋友出游  3、情侣出游  4、家庭亲子  5、单独旅行)
     */
    @TableField(value = "travel_type")
    private Integer travelType;

    /**
     * 游玩时长
     */
    @TableField(value = "travel_time")
    private String travelTime;

    /**
     * 游览时长
     */
    @TableField(value = "travel_douration")
    private String travelDouration;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Review other = (Review) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getAttractionsId() == null ? other.getAttractionsId() == null : this.getAttractionsId().equals(other.getAttractionsId()))
            && (this.getReviewAcore() == null ? other.getReviewAcore() == null : this.getReviewAcore().equals(other.getReviewAcore()))
            && (this.getReviewDetails() == null ? other.getReviewDetails() == null : this.getReviewDetails().equals(other.getReviewDetails()))
            && (this.getReviewImages() == null ? other.getReviewImages() == null : this.getReviewImages().equals(other.getReviewImages()))
            && (this.getTravelType() == null ? other.getTravelType() == null : this.getTravelType().equals(other.getTravelType()))
            && (this.getTravelTime() == null ? other.getTravelTime() == null : this.getTravelTime().equals(other.getTravelTime()))
            && (this.getTravelDouration() == null ? other.getTravelDouration() == null : this.getTravelDouration().equals(other.getTravelDouration()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getAttractionsId() == null) ? 0 : getAttractionsId().hashCode());
        result = prime * result + ((getReviewAcore() == null) ? 0 : getReviewAcore().hashCode());
        result = prime * result + ((getReviewDetails() == null) ? 0 : getReviewDetails().hashCode());
        result = prime * result + ((getReviewImages() == null) ? 0 : getReviewImages().hashCode());
        result = prime * result + ((getTravelType() == null) ? 0 : getTravelType().hashCode());
        result = prime * result + ((getTravelTime() == null) ? 0 : getTravelTime().hashCode());
        result = prime * result + ((getTravelDouration() == null) ? 0 : getTravelDouration().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userid=").append(userid);
        sb.append(", attractionsId=").append(attractionsId);
        sb.append(", reviewAcore=").append(reviewAcore);
        sb.append(", reviewDetails=").append(reviewDetails);
        sb.append(", reviewImages=").append(reviewImages);
        sb.append(", travelType=").append(travelType);
        sb.append(", travelTime=").append(travelTime);
        sb.append(", travelDouration=").append(travelDouration);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}